package View;

import java.awt.Color;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;

import Model.Radar;

public class RadarPanel extends JPanel {

	private JLabel radarnummer, positie, zichtbaar, manouvreerbaar;

	public RadarPanel(int nummer, Radar radar) {
		setLayout(new GridLayout(4, 1));
		radarnummer = new JLabel("Radar " + nummer);
		radarnummer.setForeground(Color.GREEN);
		positie = new JLabel("X: " + radar.getZicht().getCenterX() + " Y: "
				+ radar.getZicht().getCenterY());
		positie.setForeground(Color.GREEN);
		
		add(radarnummer);
		add(positie);
		if (radar.isZichtbaar()) {
			zichtbaar = new JLabel("In zicht!");
			add(zichtbaar);
			zichtbaar.setForeground(Color.GREEN);

		}
		
		if (radar.isManouvreerbaar()) {
			manouvreerbaar = new JLabel("Binnen bereik!");
			add(manouvreerbaar);
			manouvreerbaar.setForeground(Color.GREEN);
		}
		
		setBackground(Color.BLACK);

		setBorder(BorderFactory.createEtchedBorder(1, Color.GREEN.darker()
				.darker(), Color.GREEN.darker().darker()));

		if (radar.isManouvreerbaar()) {
			setBorder(BorderFactory.createEtchedBorder(1, Color.GREEN,
					Color.GREEN));
		}
		if (radar.isZichtbaar()) {
			setBorder(BorderFactory.createEtchedBorder(1, Color.WHITE,
					Color.WHITE));
		}
	}
}
